package com.study.elasticsearch.clientHighLevelClient;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class HighLevelClientConfig {

    @Bean
    public RestHighLevelClient getRestHighLevelClient(){
        RestClientBuilder builder = RestClient.builder(HttpHost.create("http://192.168.138.142:9200"));
        return new RestHighLevelClient(builder);
    }
}
